#pragma once

#include <SOIL.h>

#include <iostream>
#include <string>
#include <assert.h>

namespace Core
{
	struct ImagePixel
	{
		ImagePixel(unsigned char fr, unsigned char fg, unsigned char fb, unsigned char fa);

		ImagePixel();

		bool operator==(const ImagePixel& other)
		{
			return Equals(other);
		}

		bool operator!=(const ImagePixel& other)
		{
			return !Equals(other);
		}

		bool Equals(const ImagePixel& other);


		unsigned char R, G, B, A;
	};

	class Image
	{
	public:
		Image(const std::string& image_path);
		~Image();

		std::string GetImagePath() const { return _imagePath; }
		int GetCount() const { return _count; }
		int GetWidth() const { return _width; }
		int GetHeight() const { return _height; }
		int GetChannels() const { return _channels; }

		const ImagePixel& GetPixel(int x, int y) const;

	private:
		std::string _imagePath;
		ImagePixel* _value;

		int _count;
		int _width;
		int _height;
		int _channels;
	};
}